home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Add-Ons
/
HyperCard
/
CapsKeyDown XFCN 1.0.0
/
CapsKeyDown.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-07
|
2KB
|
64 lines
/* ----------------------------------------------------------------------
CapsKeyDown XFCN
version 1.0.0
Written by: Paul Celestin
Copyright © 1996 Celestin Company, Inc.
This XFCN tells you whether the caps lock key is down or not.
No parameters required!
960707 - 1.0.0 - initial release
---------------------------------------------------------------------- */
#include <A4Stuff.h>
#include <HyperXCmd.h>
#define PARAMETER_NUMS 0
#define PARAMETER_TEXT "\pNo parameters required!"
/* ----------------------------------------------------------------------
prototypes
---------------------------------------------------------------------- */
void DoIt(XCmdPtr paramPtr);
char LookUp[256];
/* ----------------------------------------------------------------------
main
---------------------------------------------------------------------- */
pascal void main(XCmdPtr paramPtr)
{
Str255 copyright = "\pCopyright © 1996 Celestin Company, Inc.";
long oldA4 = SetCurrentA4();
if (paramPtr->paramCount != PARAMETER_NUMS)
{
paramPtr->returnValue =
PasToZero(paramPtr,PARAMETER_TEXT);
}
else
{
DoIt( paramPtr );
}
SetA4(oldA4);
}
/* ----------------------------------------------------------------------
DoIt
---------------------------------------------------------------------- */
void DoIt(XCmdPtr paramPtr)
{
KeyMap ourKeyMap;
GetKeys(ourKeyMap);
if (BitTst(&ourKeyMap,62)) // this is the Caps lock key
paramPtr->returnValue = PasToZero(paramPtr, "\ptrue");
else
paramPtr->returnValue = PasToZero(paramPtr, "\pfalse");
}